<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:88:"/www/wwwroot/schoolnx.nxers.com/public/../application/admin/view/exam/intellectpage.html";i:1586048828;s:64:"/www/wwwroot/schoolnx.nxers.com/application/admin/view/base.html";i:1586430988;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <?php if($userInfo['is_teacher'] == 1): ?>
    <title>课程管理系统</title>
    <?php else: ?>
    <title>后台管理系统</title>
    <?php endif; ?>
    <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/static/default/css/base.css">
    <link rel="stylesheet" href="/static/default/css/fonts.css">
    <link rel="shortcut icon" href="<?php echo config('website.icon'); ?>" />
    <link rel="bookmark"href="<?php echo config('website.icon'); ?>" />
    
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-green">
        <?php if($userInfo['is_teacher'] == 1): ?>
        <div class="layui-logo">课程管理系统</div>
        <?php else: ?>
        <div class="layui-logo">后台管理系统</div>
        <?php endif; ?>
        <ul class="layui-nav layui-layout-left">
            <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$v): ?>
            <li class="layui-nav-item <?php if(isset($breadcrumb['0']) and $breadcrumb['0'] == $v['name']): ?>layui-this<?php endif; ?>">
                <a href="<?php echo \think\Request::instance()->root(true); ?>/<?php if(empty($v['url'])): ?><?php echo $v['children']['0']['url']; else: ?><?php echo $v['url']; endif; ?>"><i class="<?php echo $v['icon']; ?>"></i> <?php echo $v['name']; ?></a>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <ul class="layui-nav layui-layout-right">
           <!-- <li class="layui-nav-item"><a href="/" target="_blank"><i class="fa fa-home"></i> 首页</a></li>-->
            <li class="layui-nav-item"><a href="<?php echo url('admin/index/clear'); ?>" class="ajax-action"><i class="fa fa-trash"></i> 清除缓存</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="fa fa-user"></i> <?php echo session('admin_auth.username'); ?></a>
                <dl class="layui-nav-child">
                    <dd><a href="<?php echo url('admin/index/editPassword'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('admin/index/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item"><a href="<?php echo url('admin/index/index'); ?>"><i class="fa fa-home fa-fw"></i> 控制台</a></li>
                <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$n0): if(isset($n0['children']) and isset($breadcrumb['0']) and $breadcrumb['0'] == $n0['name']): if(is_array($n0['children']) || $n0['children'] instanceof \think\Collection || $n0['children'] instanceof \think\Paginator): if( count($n0['children'])==0 ) : echo "" ;else: foreach($n0['children'] as $key=>$n1): ?>
                <li class="layui-nav-item <?php if(isset($breadcrumb['1']) and $breadcrumb['1'] == $n1['name']): if(isset($n1['children'])): ?>layui-nav-itemed<?php else: ?>layui-this<?php endif; endif; ?>">
                    <a href="<?php if(isset($n1['children'])): ?>javascript:;<?php else: ?><?php echo \think\Request::instance()->root(true); ?>/<?php echo $n1['url']; endif; ?>"><i class="<?php echo $n1['icon']; ?> fa-fw"></i> <?php echo $n1['name']; ?></a>
                    <?php if(isset($n1['children'])): ?>
                    <dl class="layui-nav-child">
                        <?php if(is_array($n1['children']) || $n1['children'] instanceof \think\Collection || $n1['children'] instanceof \think\Paginator): if( count($n1['children'])==0 ) : echo "" ;else: foreach($n1['children'] as $key=>$n2): ?>
                        <dd<?php if(isset($breadcrumb['2']) and $breadcrumb['2'] == $n2['name']): ?> class="layui-this"<?php endif; ?>><a href="<?php echo \think\Request::instance()->root(true); ?>/<?php echo $n2['url']; ?>"><?php echo $n2['name']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                    <?php endif; ?>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
    </div>
    <div class="layui-breadcrumb">
        <?php if(isset($breadcrumb)): if(is_array($breadcrumb) || $breadcrumb instanceof \think\Collection || $breadcrumb instanceof \think\Paginator): if( count($breadcrumb)==0 ) : echo "" ;else: foreach($breadcrumb as $key=>$v): ?>
        <a><cite><?php echo $v; ?></cite></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
    </div>
    <div class="layui-body">
        
<div class="layui-card">
    <div class="layui-card-header">手动组卷</div>
    <div class="layui-card-body">
        <form action="<?php echo request()->url(); ?>" class="layui-form" method="post">
            <table class="layui-table layui-form">
                <thead>
                <tr>
                    <th>试卷名称</th>
                    <th style="width:160px;">试卷类型</th>
                    <th style="width:160px;">科目分类</th>
                    <th style="width:160px;">开考时间</th>
                    <th style="width:100px;">考试时长</th>
                    <th style="width:100px;">及格线占比</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td><input type="text" name="exam" lay-verify="required"  placeholder="必填" class="layui-input"></td>
                    <td><div class="layui-input-inline">
                        <input type="radio" name="examtype" value="1" title="练习" checked>
                        <input type="radio" name="examtype" value="2" title="考试">
                    </div>
                    </td>
                    <td><select name="examsubject" lay-verify="required" lay-filter="selectedsubjectid" id="selectedsubjectid">
                        <option value="">全部分类</option>
                        <?php if(is_array($courseCategory) || $courseCategory instanceof \think\Collection || $courseCategory instanceof \think\Paginator): if( count($courseCategory)==0 ) : echo "" ;else: foreach($courseCategory as $key=>$v): ?>
                        <option value="<?php echo $v['id']; ?>"><?php echo $v['cname']; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    </td>
                    <td><input type="text" id="starttime" name="starttime"  placeholder="为空即为不定时开始" class="layui-input"></td>
                    <td><input type="text" name="examtime" lay-verify="required|Ndouble" placeholder="单位：分钟" class="layui-input"></td>
                    <td><input type="text" name="passscore" lay-verify="required" placeholder="大于0，小于1" class="layui-input"></td>
                </tr>
                </tbody>
            </table>
            <table class="layui-table layui-form mt20" lay-skin="nob">
                <thead>
                <tr>
                    <th style="width:140px;">题型</th>
                    <th style="width:130px;">题数</th>
                    <th style="width:130px;">单题分值</th>
                    <th style="width:200px;">难度系数(简：中：难)</th>
                    <th>试题说明</th>
                </tr>
                </thead>
                <tbody>
                <?php if(is_array($questiontype) || $questiontype instanceof \think\Collection || $questiontype instanceof \think\Paginator): if( count($questiontype)==0 ) : echo "" ;else: foreach($questiontype as $key=>$v): ?>
                <tr>
                    <td><?php echo $v['type_name']; ?></td>
                    <td><input type="text" name="questype[<?php echo $v['id']; ?>][number]"   class="layui-input questypenumber"  id="iselectallnumber_<?php echo $v['id']; ?>"></td>
                    <td><input type="text" name="questype[<?php echo $v['id']; ?>][score]"   class="layui-input questypescore" id="iselectallscore_<?php echo $v['id']; ?>"></td>
                    <td><div class="layui-input-inline" style="width: 40px;">
                            <input type="text" name="questype[<?php echo $v['id']; ?>][simple]"  class="layui-input" style="width:40px;">
                        </div>：
                        <div class="layui-input-inline" style="width: 40px;">
                            <input type="text" name="questype[<?php echo $v['id']; ?>][middle]"  class="layui-input" style="width:40px;">
                        </div>：
                        <div class="layui-input-inline" style="width: 40px;">
                            <input type="text" name="questype[<?php echo $v['id']; ?>][hard]"   class="layui-input" style="width:40px;">
                        </div>
                    </td>
                    <td><input type="text" name=questype[<?php echo $v['id']; ?>][describe] id="describe_<?php echo $v['id']; ?>"   value="每小题？分，本题共？个小题，共？分" class="layui-input"></td>
                </tr>
                <?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
            </table>
            <div class="layui-form-item mt20">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="*" lay-submit="">生成试卷</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
            <input type="hidden" name="addtime" value="<?php echo $addtime; ?>"  class="layui-input">
        </form>
    </div>
</div>

    </div>
</div>
<script src="/static/libs/layui/layui.all.js"></script>
<script src="/static/libs/common/jquery.min.js"></script>
<script src="/static/libs/common/common.js"></script>
<script src="https://cdn.bootcss.com/stickyNavbar.js/1.3.5/jquery.stickyNavbar.min.js"></script>

<script>
    var allscore=[];var result=0;
    $('.questypenumber').on('blur', function () {
        var name=$(this).attr('id');
        var idArry=  name.split("_");
        var questypenumber=$(this).val();
        var questypescore=$('#iselectallscore_'+idArry[1]).val();
        var score=parseFloat(questypescore)*parseInt(questypenumber);
        var html='每小题'+questypescore+'分，本题共'+questypenumber+'个小题，共'+score+'分';
        $('#describe_'+idArry[1]).val(html);
    })
    $('.questypescore').on('blur', function () {
        var name=$(this).attr('id');
        var idArry=  name.split("_");
        var questypenumber=$('#iselectallnumber_'+idArry[1]).val();
        var questypescore=$(this).val();
        var score=parseFloat(questypescore)*parseInt(questypenumber);
        var html='每小题'+questypescore+'分，本题共'+questypenumber+'个小题，共'+score+'分';
        $('#describe_'+idArry[1]).val(html);
    })
</script>

</body>
</html>